<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>${sysName }</title>
    <script type="text/javascript" src="${ctxStatic }/js/jquery.min.js" ></script>
    <script type="text/javascript" src="${ctxStatic}/js/currency.js"></script>
    <script type="text/javascript" src="${ctxStatic}/js/index.js"></script> 
        <script type="text/javascript" src="${ctxStatic}/js/ehr/index.js"></script>
            <script type="text/javascript" src="${ctxStatic}/js/ehr/main.js"></script>
    
    <script type="text/javascript" src="${ctxStatic}/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/css/index.css">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/css/currency.css">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/fonts/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="${ctxStatic }/css/styles1.css"/>
    
</head>
<body style="height:100%;">
<script type="text/javascript">

function iFrameHeight() {   
	var ifm= document.getElementById("myIframe");   
	var subWeb = document.frames ? document.frames["myIframe"].document : ifm.contentDocument;   
	if(ifm != null && subWeb != null) {
	   ifm.height = subWeb.body.scrollHeight>1000?subWeb.body.scrollHeight:1000;
	} 
}

$(function(){
    $.ajax({  
        type: "GET",  
        url: "${ctx}/getMenu?sysId=${sysId}",
        dataType:"json", 
        success:function(data){
        	var menuStr="";
        	for(var i=0;i<data.data.length;i++){
        		var thisMenu='<li>' + '<a href="javascript:void(0)"><i class="nav-icon"></i>' + data.data[i].name + '<span class="glyphicon glyphicon-plus"></span></a>'
        		if(data.data[i].id==530){
            		thisMenu=thisMenu + "<ul style='height: 300px; display: block; overflow-y: auto;'>";
        		}else{
            		thisMenu=thisMenu + "<ul >";
        		}
        		if(data.data[i].userMenu!=null){
	        		for(var j=0;j<data.data[i].userMenu.length;j++){
	        				thisMenu=thisMenu + '<li><a href="${hms}' +  data.data[i].userMenu[j].url + '"' + 'target="myIframe" data-options="概况,'  + data.data[i].userMenu[j].url + '" >' + data.data[i].userMenu[j].name + '</a></li>';
	        		}
        		}
        		thisMenu=thisMenu + '</ul>' + '</li>';
        		menuStr=menuStr + thisMenu;
        	}
    		$("#dynamicMenu").html(menuStr); 
    		$(".nav-menu>ul>li>a").on("click",function() {// 点击菜单切换显示二级菜单
				// $(this).parent().addClass("on").siblings().removeClass("on");
				$(this).parent().find("ul").slideToggle("500").closest("li").siblings("li").children("ul").slideUp("500"); 
        var _icon=$(this).find("span");
        changeIcon(_icon);
			}).parent().siblings().find("ul").slideUp("500");
        },  
        error:function(data){  
     		alert("页面上发生了一个错误!");
        }  
     });
})

</script>
<div class="container full-height"> 
    <div class="row full-height">
        <!-- left menu -->
        <nav class="col-md-2 full-height" style="background-color: rgb(50,140,200);">
            <div class="row nav_in"> 
                <div class="panel-body panel-logo">
        		<img src="${ctxStatic}/image/logo/1.png" style="width:100%;"> 
                </div>
                <!-- 主菜单 -->
                <div class="nav-menu">
                	<!-- 生成的动态菜单将放在下面这个ul中 -->
                    <ul id="dynamicMenu">

                    </ul>
                </div>
               	<div class="nav_a health" data-to="1">
						双向转诊 <span class="heath-span"></span>
				</div> 
				<ul class="health_ul" hidden=""> 
						<li class="caret-l hypertension" hidden="" id="hypertension">高血压管理 
							<div class=""><a href="${ctx }/hypertension/getHypertensionInfo?healthFileCode=${healthFileCode}" target="myIframe">注册</a></div>
							<div class=""><a href="${ctx }/views/hypertension/hypertensionFollowUpInfo.jsp" target="myIframe">随访</a></div>
						</li>
				</ul>
            </div>  
        </nav>
        <!-- right section -->
        <div class="col-md-10 full-height" id="right-column">
            
        	<div class="main_right">
				<!--右边头部-->
				<div class="main_top">
					 <div class="mTop_r">
						<div class="login mt10">
							<a id="logOut" href="${ctx}/views/login.jsp">退出系统</a>
						</div>
					</div> 
				</div> 
				<!--右边头部结束-->			
				<iframe src="" width="1160" height="1000" frameborder="0"  scrolling="no" class="table_fram" id="myIframe" name="myIframe" onLoad="iFrameHeight()"></iframe>			
		   </div>
		</div>
    </div>
</div>

<script type="text/javascript" src="${ctxStatic}/js/bootstrap.min.js"></script>
</body>
</html>
